<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateReportTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('report', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('举报用户ID');
            $table->integer('reported_user_id')->comment('被举报用户ID');
            $table->integer('moment_id')->comment('被举报动态ID');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('状态：0-无效，1-有效');
            $table->index('user_id', 'user_id');
            $table->index('reported_user_id', 'reported_user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('report');
    }
}
